﻿<UserControl x:Class="InsuranceAdjuster.Controls.HelpControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:InsurancePage="clr-namespace:InsuranceAdjuster"
    mc:Ignorable="d"
    d:DesignHeight="800" d:DesignWidth="800"
    DataContext="{Binding RelativeSource={RelativeSource Self}}"
    x:Name="damagesPage">
    <UserControl.Resources>
        <ControlTemplate x:Key="textSizeButton">
            <TextBlock VerticalAlignment="Center">A</TextBlock>
        </ControlTemplate>
        <Style TargetType="RichTextBox">
            <Setter Property="BorderThickness" Value="0" />
            <Setter Property="Background" Value="#FFFFFFFF" />
            <Setter Property="Foreground" Value="#FF000000" />
            <Setter Property="Padding" Value="0" />
            <Setter Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFA3AEB9" Offset="0"/>
                        <GradientStop Color="#FF8399A9" Offset="0.375"/>
                        <GradientStop Color="#FF718597" Offset="0.375"/>
                        <GradientStop Color="#FF617584" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="RichTextBox">
                        <Grid x:Name="RootElement">

                            <Border x:Name="Border" BorderThickness="0" CornerRadius="1" Opacity="1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}">
                                <Border x:Name="MouseOverBorder" BorderThickness="0" BorderBrush="Transparent">
                                    <ScrollViewer x:Name="ContentElement" Padding="0" BorderThickness="0" IsTabStop="False" />
                                </Border>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="RichTextBoxOverflow">
            <Setter Property="BorderThickness" Value="0" />
            <Setter Property="Background" Value="#FFFFFFFF" />
            <Setter Property="Foreground" Value="#FF000000" />
            <Setter Property="Padding" Value="0" />
            <Setter Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFA3AEB9" Offset="0"/>
                        <GradientStop Color="#FF8399A9" Offset="0.375"/>
                        <GradientStop Color="#FF718597" Offset="0.375"/>
                        <GradientStop Color="#FF617584" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="RichTextBoxOverflow">
                        <Grid x:Name="RootElement">
                            <Border x:Name="Border" BorderThickness="0" CornerRadius="1" Opacity="1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}">
                                <Border x:Name="MouseOverBorder" BorderThickness="0" BorderBrush="Transparent">
                                    <ScrollViewer x:Name="ContentElement" Padding="0" BorderThickness="0" IsTabStop="False" />
                                </Border>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
	<StackPanel x:Name="LayoutRoot">
            <Grid Background="Black">
                <Grid.RowDefinitions>
                    <RowDefinition Height="50"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="300"/>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="300"/>
                </Grid.ColumnDefinitions>
                <Rectangle Fill="{StaticResource GrayBackground}" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Grid.RowSpan="6"/>
                <TextBlock FontFamily="Segoe Semibold" Foreground="#FF47443D" FontSize="{Binding Path=CurrentHeaderTextSize}" CharacterSpacing="200" VerticalAlignment="Center" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Text="{Binding Path=TitleText}"/>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Height="40" VerticalAlignment="Center" Grid.Row="0" Grid.Column="2">
                    <Button x:Name="smallFontSizeButton" Click="ReduceTextSize" Template="{StaticResource textSizeButton}" FontSize="15" Foreground="LightGray"/>
                    <Button x:Name="defaultFontSizeButton" Click="ResetTextSize" Template="{StaticResource textSizeButton}" FontSize="25" Margin="5,0,5,0"/>
                    <Button x:Name="largeFontSizeButton" Click="IncreaseTextSize"  Template="{StaticResource textSizeButton}" FontSize="35" Foreground="LightGray" Margin="0,0,5,0" />
                </StackPanel>
		</Grid>
        <ScrollViewer x:Name="baseScrollViewer" VerticalScrollBarVisibility="Visible" FontFamily="Arial">
            <Grid Background="Black">
                <Grid.RowDefinitions>
                    <RowDefinition Height="0"/>
                    <RowDefinition Height="135"/>
                    <RowDefinition Height="23"/>
                    <RowDefinition Height="224"/>
                    <RowDefinition Height="138"/>
                    <RowDefinition Height="23"/>
                    <RowDefinition Height="230"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="300"/>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="300"/>
                </Grid.ColumnDefinitions>
                <TextBlock FontSize="{Binding Path=CurrentTextSize}" Foreground="#FF47443D"  FontWeight="ExtraBold" CharacterSpacing="200" HorizontalAlignment="Center" Grid.Row="2" Grid.Column="2" Text="{Binding Path=VideoTitle}"/>
                <TextBlock FontSize="{Binding Path=CurrentTextSize}" Foreground="#FF47443D"  FontWeight="ExtraBold" CharacterSpacing="200" HorizontalAlignment="Center" Grid.Row="5" Grid.Column="0" Text="{Binding Path=ImageTitle}"/>
                <RichTextBox IsReadOnly="True" VerticalScrollBarVisibility="Disabled"
                         OverflowContentTarget="{Binding ElementName=overflowContainer1}" Grid.Row="1" Grid.ColumnSpan="3" >
                    <Paragraph FontFamily="Segoe Semibold"  Foreground="#FF47443D" FontSize="{Binding Path=CurrentSubHeaderTextSize}" FontWeight="Bold">
                        Driver Duty
                    </Paragraph>
                    <Paragraph FontSize="{Binding Path=CurrentTextSize}" TextAlignment="Justify">
                        Look at the "driver duty" for each
                        <Hyperlink Click="Hyperlink_Click" >driver</Hyperlink> . Every person behind the wheel of a car assumes driver duties. It does not matter if you have a license or no, it does not matter if you are an adult or a toddler. The law will place affirmative duties in every driver for purposes of accident fault. Usually the duties every driver must follow are "lookout, avoidance, and obey the rules of the road."
                    </Paragraph>
                    <Paragraph FontSize="{Binding Path=CurrentTextSize}" TextAlignment="Justify">
                        Determine if any of the driver breach any of their duties. This means that both drivers must be interviewed to determine if they were following the rules of road, if they were paying attention, and if both of them attempted to avoid the accident.
                    </Paragraph>
                    <Paragraph FontFamily="Segoe Semibold" Foreground="#FF47443D" FontSize="{Binding Path=CurrentSubHeaderTextSize}" FontWeight="Bold">
                        <LineBreak/> Collision Avoidance
                    </Paragraph>
                    <Paragraph FontSize="{Binding Path=CurrentTextSize}" TextAlignment="Justify">
                        Determine if the drivers actually attempted to avoid the collision. When looking at accident fault, you must look at avoidance carefully. Avoidance is exactly that. The driver must attempt to avoid the accident. The fact that another car is at fault, or has done something illegal does not give the driver license to hit them.
                    </Paragraph>
                    <Paragraph FontFamily="Segoe Semibold" Foreground="#FF47443D" FontSize="{Binding Path=CurrentSubHeaderTextSize}" FontWeight="Bold">
                        <LineBreak/> Rules of the Road
                    </Paragraph>
                    <Paragraph FontSize="{Binding Path=CurrentTextSize}" TextAlignment="Justify">
                        Double check the rules of the road. When it comes to assessing accident fault, the obvious requirement is that every one must obey the traffic laws. Drivers must be in full compliance with all the traffic laws that apply to the accident. Traffic laws are codified in all states in the state annotated code or the administrative code (the name changes per state).
                    </Paragraph>
                    <Paragraph FontFamily="Segoe Semibold" Foreground="#FF47443D" FontSize="{Binding Path=CurrentSubHeaderTextSize}" FontWeight="Bold">
                        <LineBreak/> Duty Breach
                    </Paragraph>
                    <Paragraph FontSize="{Binding Path=CurrentTextSize}" TextAlignment="Justify">
                        Determine which duties were breached by each driver. Look at accident fault as if each driver is acting alone. Look at the breached duties and determine which breaches are more substantial than others. For example, if driver A breached the duty to conserve speed v. driver B breached the duty to stop at the stop sign. The duty to stop a stop sign probably weights more because a stop sign gives the right of way to other traffic.
                    </Paragraph>
                    <Paragraph FontFamily="Segoe Semibold" Foreground="#FF47443D" FontSize="{Binding Path=CurrentSubHeaderTextSize}" FontWeight="Bold">
                        <LineBreak/> Duty Breach and Damages
                    </Paragraph>
                    <Paragraph FontSize="{Binding Path=CurrentTextSize}" TextAlignment="Justify">
                        After looking at duties breached, you must establish a casual relationship between the breached duty and the ultimate damage. Let us assume that Driver is legally parked in a parking lot. Let us further assume that Driver is drunk in the driver's seat and that the engine is running while someone pulls out of a parking stall and hits Driver's car. Is Driver negligent? The answer for purposes accident fault is NO. The fact that Driver was drunk did not cause the accident. There was not casual connection between the fact that Driver was dunk and that a vehicle came and hit his/her car while waiting.
                    </Paragraph>
                    <Paragraph FontSize="{Binding Path=CurrentTextSize}" TextAlignment="Justify">
                        Establish the amount of damages. Damages must exist either as property damage or as a bodily injury. The important thing to remember is that all damages must be related to the duty breach. In other words, if you have back pain and a headache, the analysis explained above will be applied twice (one time for the back pain and one time for the headache). You must show that the specific car accident caused injury you are claiming. Many times this is easy, but sometimes, showing that a low speed impact caused a neck injury could be difficult.
                    </Paragraph>
                </RichTextBox>
                <RichTextBoxOverflow x:Name="overflowContainer1" OverflowContentTarget="{Binding ElementName=overflowContainer2}" Grid.Row="2" Grid.RowSpan="2" Grid.ColumnSpan="2" VerticalScrollBarVisibility="Disabled"/>
                <RichTextBoxOverflow x:Name="overflowContainer2" OverflowContentTarget="{Binding ElementName=overflowContainer3}" Grid.Row="4" Grid.ColumnSpan="3" VerticalScrollBarVisibility="Disabled"/>
                <RichTextBoxOverflow x:Name="overflowContainer3" Grid.Row="5" Grid.ColumnSpan="2" Grid.Column="1" Grid.RowSpan="2" VerticalScrollBarVisibility="Disabled"/>
                <!--OverflowContentTarget="{Binding ElementName=overflowContainer4}" -->
                <RichTextBoxOverflow x:Name="overflowContainer4" Grid.Row="7" Grid.ColumnSpan="3" VerticalScrollBarVisibility="Disabled"/>
                <Image Source="{Binding Path=ImageSource}" Stretch="Fill" Grid.Row="6" Grid.Column="0" Margin="0,0,10,0"/>
                <InsurancePage:MediaPlayer x:Name="mediaControl" MediaSource="/car_isurance.wmv" BorderThickness="2" VerticalAlignment="Center" Grid.Row="3" Grid.Column="2" Margin="10,0,0,0"/>
            </Grid>
        </ScrollViewer>
	</StackPanel>
</UserControl>
